package com.int_tech.messionLog.service;

import com.int_tech.messionLog.dao.MessionLogDao;
import com.int_tech.messionLog.entity.MessionLog;
import com.int_tech.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/9/20.
 */
@Service
public class MessionLogService {

    @Autowired
    private MessionLogDao messionLogDao;
    /**
    * TODO 根据任务单号按时间降序查询
    * @param messionNumber
    * @return Result(List<MessionLog>)
    * @author dmy
    */
    public Result findMessionLogByMessionNumberTimeDesc(String messionNumber){
        try {
            List<MessionLog> list = messionLogDao.findMessionLogByMessionNumberOrderByCreateTimeDesc(messionNumber);
            return Result.ok(list);
        } catch (Exception e) {
        	// TODO: handle exception
        	e.printStackTrace();
        	return Result.build(500,"异常");
        }
    }
}
